package service

import (
	"awesomeTask/application/models/master"
	awesomeTask "awesomeTask/config"
	"awesomeTask/system/crontab"
	"awesomeTask/system/kernel"
	"awesomeTask/system/log"
)

type IocService struct {
}

func (ioc IocService) Register() {
	instance := kernel.GetIocInstance()
	/**
	注册日志组件
	*/
	instance.BindCreateObject("logger", func() interface{} {
		return log.FileLoger{LogPath: awesomeTask.GetConfigByKey("logPath").(string)}
	}, true)
	instance.BindCreateObject("command", func() interface{} {
		return kernel.GetKernelDriver()
	}, true)
	instance.BindCreateObject("master", func() interface{} {
		return master.MasterInstance{}
	}, true)
	instance.BindCreateObject("mainCron", func() interface{} {
		return crontab.CronManager{}
	}, true)
}
func (ioc IocService) Boot() {

}
